#encoding:utf8

import os
import sys
import subprocess
import shutil
from lib import *

srvip           = '10.12.0.10'
studio          = r'\\%s\Studio05\studio\lixianmin01083'%(srvip)

def open_studio():
    '''open my studio directory on the server'''
    cmd = 'explorer.exe ' + studio
    subprocess.Popen(cmd)

def login():
    username    = 'lixianmin'
    password    = 'lixianmin516'
    wsh.login(studio, username, password)

    #create server folder if not exists
    if not os.path.exists(studio):
        os.mkdir(studio)

#############################################################################################

def main():
    # first login
    login()
    
    # dispatcher
    dispatcher  = ArgumentDispatcher(open_studio)
    dispatcher.run()

if __name__=='__main__':main()
